const dialog = {
    state: {
        dlgShow: false,
        dlgName: '',
        dlgParams: { // 方便扩展
            name: '',
            params: null// 弹窗携带参数
        }
    },
    mutations: {
        DLGSHOW: (state, dlgShow) => {
            state.dlgShow = dlgShow
        },
        DLGNAME: (state, dlgName) => {
            state.dlgName = dlgName
        },
        DLGPARAMS: (state, params) => {
            state.params = params
        }
    },
    actions: {
        dlgShow: ({ commit }, dlgShow) => {
            commit('DLGSHOW', dlgShow)
        },
        dlgName: ({ commit }, dlgName) => {
            commit('DLGNAME', dlgName)
        },
        dlgParams: ({ commit }, dlgParams) => {
            commit('DLGPARAMS', dlgParams)
        }
    }
}

export default dialog
